import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import router from "./router"

// 刷新时没有调用子路由定义的路径
import getRoutes from './grants/router'

// 引入创建的vuex
import store from './store'

const app = createApp(App)

app.use(store)

if (sessionStorage.getItem("grants")) {
    getRoutes(); //只获取会在登录和刷新都调用
    // 用vuex解决动态添加路由配置
    store.commit({
        type: "setIsAddRoute",
        isAddRoute: true
    });
}

app.use(router)

app.mount('#app')
